package com.chinasofti.service;

import com.chinasofti.dao.DepartmentDao;
import com.chinasofti.vo.Department;

import java.util.List;

public class DepartmentService {
    private DepartmentDao dao = new DepartmentDao();

    public List<Department> viewAllDepartments(){
        return dao.selectAll();
    }


    public void addDepartment(String departmentname) {
        dao.insert(departmentname);
    }

    public void deleteDepartment(Integer departmentid) {
        dao.delete(departmentid);
    }
    public void updateNameById(int departmentid, String departmentname) {
        dao.updateNameById(departmentid,departmentname);
    }
}
